home *** CD-ROM | disk | FTP | other *** search
/ VRML 2.0 Sourcebook (2nd Edition) / VRML 2.0 Sourcebook CD [md5 fed90f4f9c39d5a60d477058775c7e21].iso / book / win / ch30 / 30fig05.wrl < prev    next >
Text File  |  1996-09-23  |  939b  |  36 lines

  1. #VRML V2.0 utf8
  2. # The VRML 2.0 Sourcebook
  3. # Copyright [1997] By
  4. # Andrea L. Ames, David R. Nadeau, and John L. Moreland
  5. Group {
  6.     children [
  7.     # Donut, initially empty
  8.         Shape {
  9.             appearance Appearance {
  10.                 material Material { }
  11.             }
  12.             geometry DEF Donut Extrusion {
  13.                 crossSection [ ]
  14.                 spine [ ]
  15.                 creaseAngle 1.57
  16.                 beginCap FALSE
  17.                 endCap   FALSE
  18.             }
  19.         },
  20.     # Donut maker
  21.         DEF DonutMaker Script {
  22.             url "donutmkr.js"
  23.             field    SFFloat crossSectionRadius     1.0
  24.             field    SFFloat spineRadius            2.0
  25.             field    SFInt32 crossSectionResolution 16
  26.             field    SFInt32 spineResolution        16
  27.             eventIn  SFFloat set_crossSectionRadius
  28.             eventIn  SFFloat set_spineRadius
  29.             eventOut MFVec2f crossSection_changed
  30.             eventOut MFVec3f spine_changed
  31.         }
  32.     ]
  33. }
  34. ROUTE DonutMaker.crossSection_changed TO Donut.set_crossSection
  35. ROUTE DonutMaker.spine_changed        TO Donut.set_spine
  36.